package com.thb.pay.api.agent;


import com.thb.pay.api.agent.fallback.AgentInfoServiceApiFallbackFactory;
import com.thb.pay.api.agent.vo.req.AgentInfoPageReq;
import com.thb.pay.api.agent.vo.req.AgentInfoReq;
import com.thb.pay.api.agent.vo.resp.AgentInfoVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 代理商-信息表 前端控制器
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@FeignClient(value = "pay-service", fallbackFactory = AgentInfoServiceApiFallbackFactory.class)
@RequestMapping("/agentInfoApi")
public interface AgentInfoServiceApi {

    /**
     * @param pageReq
     * @Description 分页获取代理商信息
     * @Author lucky
     * @data 2019/7/26 0:07
     */
    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<AgentInfoVo> findPage(@RequestBody AgentInfoPageReq pageReq);

    /**
     * @param agentInfoReq
     * @Description 获取代理商列表信息
     * @Author lucky
     * @data 2019/10/14
     */
    @RequestMapping(value = "/findListByAgent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    List<AgentInfoVo> findListByAgent(@RequestBody AgentInfoReq agentInfoReq);

    /**
     * @param agentInfo 代理商信息
     * @Description 添加代理商信息
     * @Author lucky
     * @data 2019/7/27 11:51
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void add(@RequestBody AgentInfoReq agentInfo);

    /**
     * @param loginName 登入名 【邮箱、账号名称、手机号】
     * @Description 获取登入信息
     * @Author lucky
     * @data 2019/7/27 12:23
     */
    @RequestMapping(value = "/getByLoginName", method = RequestMethod.GET)
    AgentInfoVo getByLoginName(@RequestParam("loginName") String loginName);

    /**
     * @param agentId 代理商ID
     * @Description 获取代理商信息
     * @Author lucky
     * @data 2019/7/27 12:24
     */
    @RequestMapping(value = "/getByAgentId", method = RequestMethod.GET)
    AgentInfoVo getByAgentId(@RequestParam("agentId") Long agentId);

    /**
     * @param agentInfoReq 代理商信息
     * @Description 修改代理商信息
     * @Author lucky
     * @data 2019/7/27 11:51
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void update(@RequestBody AgentInfoReq agentInfoReq);
}
